<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>  
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>后台管理系统</title>
<meta name="author" content="DeathGhost" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resources/css/style.css" />
<script src="<%=request.getContextPath()%>/resources/js/jquery.js"></script>
<script src="<%=request.getContextPath()%>/resources/js/jquery.mCustomScrollbar.concat.min.js"></script>
<script>
	function view(id){
		//页面层-自定义
		layer.open({
		  type: 2,
		  fix: false, //不固定
		  area: ['500px', '95%'],
		  maxmin: true,
		  content: "view.do?id="+id
		});
	}
	
	function change(){
		$("#changeForm").submit();
	}
</script>
</head>
<body>
	<!--header-->
	<jsp:include page="../common/header.jsp"></jsp:include>

	<section class="rt_wrap content mCustomScrollbar">
		<div class="rt_content">
			<p>&nbsp;</p>
			<div class="page_title">
				<h2 class="fl">日志列表</h2>
				<a class="fr top_rt_btn delete checkAuth" auth="log:delete">删除</a>
				<form id="changeForm" action="list.do">
					<select name="operation" class="fr top_rt_btn" onchange="change()" style="height:32px;line-height: 32px;">
						<option <c:if test="${operation==''}">selected</c:if> value="">全部日志</option>
						<option <c:if test="${operation=='修改订单补充说明'}">selected</c:if> value="修改订单补充说明">修改订单补充说明</option>
						<option <c:if test="${operation=='修改订单'}">selected</c:if> value="修改订单">修改订单</option>
						<option <c:if test="${operation=='添加订单'}">selected</c:if> value="添加订单">添加订单</option>
						<option <c:if test="${operation=='删除订单'}">selected</c:if> value="删除订单">删除订单</option>
						<option <c:if test="${operation=='导入订单'}">selected</c:if> value="导入订单">导入订单</option>
						<option <c:if test="${operation=='导出订单'}">selected</c:if> value="导出订单">导出订单</option>
						<option <c:if test="${operation=='添加角色'}">selected</c:if> value="添加角色">添加角色</option>
						<option <c:if test="${operation=='修改角色'}">selected</c:if> value="修改角色">修改角色</option>
						<option <c:if test="${operation=='删除角色'}">selected</c:if> value="删除角色">删除角色</option>
						<option <c:if test="${operation=='添加管理员'}">selected</c:if> value="添加管理员">添加管理员</option>
						<option <c:if test="${operation=='修改管理员'}">selected</c:if> value="修改管理员">修改管理员</option>
						<option <c:if test="${operation=='删除管理员'}">selected</c:if> value="删除管理员">删除管理员</option>
						<option <c:if test="${operation=='删除日志'}">selected</c:if> value="删除日志">删除日志</option>
					</select>
				</form>
			</div>
			<table class="table">
				<tr>
					<th style="width: 40px;"><input type="checkbox" value="-1" id="checkAll" /><label for="checkAll">全选</label></th>
					<th>行号</th>
					<th>
						操作
					</th>
					<th>
						操作员
					</th>
					<th>
						IP
					</th>
					<th style="width: 400px;">
						内容
					</th>
					<th>
						操作日期
					</th>
					<th>
						操作
					</th>
				</tr>
				<c:forEach items="${page.content }" var="log" varStatus="index">
					<tr>
						<input class="id" type="hidden" value="${log.id }" />
						<td align="center">
							<input type="checkbox" class="ids" name="ids" value="${log.id}" />
						</td>
						<td>${index.index+1}</td>
						<td>
							${log.operation}
						</td>
						<td>
							${log.operator}
						</td>
						<td>
							${log.ip}
						</td>
						<td>
							<c:if test="${not empty log.content }">
								<%-- <c:choose>  
							         <c:when test="${fn:length(log.content) > 18}">  
										<span title="${log.content}">${fn:substring(log.content, 0, 20)}...</span>
							         </c:when>  
							        <c:otherwise>  
							           <c:out value="${log.content}" />  
							         </c:otherwise>  
							     </c:choose>   --%>
							     ${log.content}
							</c:if>
						</td>
						<td>
							<span title="${log.createDate}">${log.createDate}</span>
						</td>
						<td>
							<a href="javascript:;" onclick="view(${log.id})">[查看]</a>
						</td>
					</tr>
				</c:forEach>
			</table>
			<form id="pageForm" action="list.do">
				<input type="hidden" name="operation" value="${operation }">
				<jsp:include page="../common/page.jsp"></jsp:include>
			</form>
		</div>
	</section>
	<!--结束：以下内容则可删除，仅为素材引用参考-->
</body>
</html>

